package com.zh.note.huawei.onehundred.整数分解;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        try {
            Scanner s = new Scanner(System.in);
            int t = s.nextInt();
            if (t < 1 || t > 1000) {
                System.out.println("input error");
                return;
            }
            //输出自己
            System.out.println(t + "=" + t);
            List<String> resultList = new ArrayList<>();
            for (int j = 1; j < t; j++) {
                //统计和
                int total = 0;
                //记录表达式
                StringBuilder sb = new StringBuilder();
                for (int k = j; k < t; ++k) {
                    total += k;
                    if (t == total) {
                        sb.append(k);
                        resultList.add(t + "=" + sb);
                        break;
                    }
                    if (total >= t) {
                        break;
                    }
                    sb.append(k).append("+");
                }
            }
            resultList.sort(Comparator.comparingInt(String::length));
            resultList.forEach(System.out::println);
            System.out.println("Result:" + (resultList.size() + 1));
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("input error");
        }
    }
}

